SNES Opcode Searcher v0.1.4b by phonymike

*description
This tool will search through the provided ROM file and display matching 65816 assembly instructions that access the provided memory address or addresses. It cannot tell the difference between assembly opcodes and data, so not all results will be correct.

*examples
If you have a memory address from a PAR code for instance, 7E1C00, type "opsearch ROM.sfc 7E1C00" and results will be shown as file location (as seen in a hex editor) and SNES memory address. You can also search a range of addresses like "opsearch ROM.sfc 7E1C00 7E1D00". This might come in handy to find RAM locations that are unused. Long addresses (4 bytes) are different than Short addresses (3 bytes), so you can try "opsearch ROM.sfc 1C00 1D00 /short" to find more locations.

To verify that these are actually assembly instructions and not data, I use no$sns and jump to the location to see if the location has assembly code, or random data. You may have to toggle the 'm' flag in no$sns to set 8/16 bit accumulator.

*for n00bs
This is a command line utility for Windows. Double clicking it will only make a black window appear and then disappear, you must launch it from the command line. Place the opsearch.exe into a folder with your ROM file using explorer, hold the shift key, and right click on an empty part of the window and select something like "Open command window here". Then type in your command as shown in the examples section.

*source code
I included the C source code, I hope you can learn something from it. Don't send me any mean comments about it or you won't get any more :)

I compile it using the Digital Mars C/C++ Compiler with Basic Utilities (for the resource compiler), but I use GNU Make.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
version 0.1.4b:
Added more opcodes:
TSB TRB BIT STY STZ LDY CPY CPX
ASL ROL LSR ROR STX LDX DEC INC

Index always showed as X, now Y shows correctly.
Made test_codes.bin to verify test cases.
Added check for minimum ROM file size.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
version 0.1.3b:
Added HiROM and LoROM detection.
Increased ROM size to 48 mbit


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
version 0.1.0b:
First release, shows the following opcodes:
ORA AND EOR ADC STA LDA CMP SBC

